package com.xmx.ndmallwxapi.controller;

import com.xmx.common.utils.R;
import com.xmx.ndmallwxapi.service.IndexServie;
import com.xmx.ndmallwxapi.service.IndexServie2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/8/11 10:35
 */
@RestController
@RequestMapping("/wx/home")
public class HomeController {

    @Resource
    IndexServie indexServie;

    @Resource
    IndexServie2 indexServie2;

    @GetMapping("/index")
    public R index() throws ExecutionException, InterruptedException {
        Map indexMap = indexServie.findIndexData();
        System.out.println(indexMap);
        return R.ok().put("data",indexMap);
    }

    @GetMapping("/index2")
    public R index2()  {
        Map indexMap = indexServie2.findIndexData();
        System.out.println(indexMap);
        return R.ok().put("data",indexMap);
    }


}
